home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-2.iso / Files II / Prog / T / ToolsPlus 2.1.sit / Tools Plus 2.1 ƒ / Tools Plus 2.1 (C & Pascal) / User Manual / 12-System Polling (1 of 4) < prev    next >
Encoding:
Text File  |  1993-10-24  |  28.0 KB  |  533 lines  |  [TEXT/ttxt]

  1. 12  System Polling
  2. ``````````````````
  3.  
  4. This chapter deals entirely with system polling and events.  It details how Tools Plus reports events, and how your application should respond to them.  This chapter is laid out as follows:
  5.    • System polling is detailed
  6.    • Task switching is detailed
  7.    • The Macintosh’s event reporting and queuing mechanism is explained
  8.    • Automatic event filtering when a watch cursor is displayed is
  9.      explained
  10.    • Tools Plus’s event record and its fields are detailed
  11.    • Event modifier keys are explained (Caps Lock, Shift, Option,
  12.      Command and Control)
  13.    • The PollSystem function is detailed.  All possible event codes are
  14.      listed here.  PollSystem’s internal workings are also described.
  15.    • Each possible event is detailed, along with the correct response
  16.      that should be taken by your application
  17.    • A Field To Event Cross Reference table quickly identifies when each
  18.      field in the polling record is used
  19.    • The polling routine’s execution time is discussed for applications
  20.      in which speed is critical
  21.  
  22.  
  23.  
  24.  
  25.  
  26. What Is Polling?
  27. ````````````````
  28.   In the purest sense, polling is a periodic process in which your application asks what has happened?  This gives your application the ability to respond to its environment, as well as to its own internal mechanisms.  The Macintosh’s Toolbox Event Manager creates and manages those events, however, they are at a very low level and require a lot of work before your application can use them.
  29.  
  30.   Your application must constantly poll the system and respond to the reported events, and it does so with Tools Plus’s polling routine, PollSystem.
  31.  
  32.   PollSystem is the heart-beat of Tools Plus.  It is called by your application to obtain events generated by the user, such as typing or clicking the mouse.  In fact, all events are obtained this way.  The big difference here is that PollSystem does everything it possibly can before handing an event back to your application.  Some events are processed internally and are never reported to your application, such as when the user types in an Editing Field (the field automatically processes the typing).  Other events are reported to your application, such as when the user clicks a button.  The events reported to your application are in a format that your application can readily use.
  33.  
  34.  
  35.  
  36.  
  37.  
  38. Task Switching
  39. ``````````````
  40.   With the introduction of System 5, MultiFinder made cooperative multi-tasking a reality on the Macintosh.  Cooperative, or “switched” multi-tasking as it is often called, lets several applications run simultaneously by cycling amongst all the tasks.  The term “cooperative” is used because each application must cooperate with all others by relinquishing control to give the others some processing time.
  41.  
  42.   Only one application can be active (the front most window) at a time under MultiFinder and System 7, even though, potentially, you may be able to see dozens of windows from multiple applications simultaneously.  Therefore, the active application is temporarily “suspended” when another application (or desk accessory) is activated.  Please note that suspended applications can also receive events and processing time.
  43.  
  44.   There are two kinds of “switches” that occur in cooperative multi-tasking: minor and major.  In a major switch, your application is either suspended when another application or desk accessory is activated, or resumed when your application is activated.  The doSuspend and doResume events report this occurrence to your application.  In a minor switch, your application is given some processing time, then it releases control to another application or desk accessory.
  45.  
  46.   PollSystem takes care of task switching.  When your application calls PollSystem, a major or minor switch always occurs.  You only need to concern yourself with minor switches by calling PollSystem as frequently as possible.  In other words, don’t let your application run for ten seconds before calling PollSystem, or other applications will work jerkily, or worse yet, appear to mysteriously “hang” when in actuality they just aren’t getting enough cooperation from your application.  The doSuspend and doResume events detail how your application should respond to a major switch.
  47.  
  48.   See the SIZE resource to specify how your application will behave while suspended, and during the transition from being active to inactive or vice versa.
  49.  
  50.  
  51.  
  52.  
  53.  
  54. Macintosh Events
  55. ````````````````
  56.   The Toolbox Event Manager, as described in chapter 8 of Inside Macintosh Volume I, is the link between your application and its user, and its machine environment.  Whenever the user types a key on the keyboard or numeric keypad, presses the mouse button, or inserts a disk in the disk drive, the Macintosh makes your application aware of this by means of an event.
  57.  
  58.   In addition to monitoring the user’s actions, the Macintosh’s Toolbox Event Manager also detects other types of events that serve to inform your application as to “what is happening.”  Such an event is reported when a partially obscured window is uncovered and its contents need to be redrawn (update event).
  59.  
  60.   The Toolbox Event Manager’s events contain an event code that identifies the type of event.  Event codes are available as constants.  Later, you will learn how the Macintosh’s Toolbox Event Manager’s events are automatically translated into Tools Plus events.  The list below is for reference purposes only, since your application will likely never make use of the Toolbox Event Manager’s events directly.
  61.  
  62.   CONST   
  63.     nullEvent      =0;    {no event detected                      }
  64.     mouseDown      =1;    {mouse button was pressed down          }
  65.     mouseUp        =2;    {mouse button was released              }
  66.     keyDown        =3;    {a key was pressed                      }
  67.     keyUp          =4;    {a key was released                     }
  68.     autoKey        =5;    {a key was held down and is repeating   }
  69.     updateEvt      =6;    {a window must be update (refreshed)    }
  70.     diskEvt        =7;    {a disk was inserted                    }
  71.     activateEvt    =8;    {a window was activated or deactivated  }
  72.     networkEvt     =10;   {network                                }
  73.     driverEvt      =11;   {device driver                          }
  74.     app1Evt        =12;   {application-defined event number 1     }
  75.     app2Evt        =13;   {application-defined event number 2     }
  76.     app3Evt        =14;   {application-defined event number 3     }
  77.     app4Evt        =15;   {appl-defined event 4 / MultiFinder’s   }
  78.                           {  and Switcher’s Suspend/Resume event  }
  79.     osEvt          =15;   {Operating-system event (System 7)      }
  80.     kHighLevelEvent=23;   {High-level event (System 7)            }
  81.  
  82.  
  83.  
  84.  
  85.  
  86. Watch Cursor -- a busy system
  87. `````````````````````````````
  88.   The watch cursor is used to indicate a long wait, such as when a lengthy process is being conducted or when printing is being done.  Your application can display the watch cursor by calling CursorShape(watchCursor).
  89.  
  90.   While the watch cursor is displayed, your application may choose not to call PollSystem, since it doesn’t care what the user is doing and will want to ignore mouse clicks and typing anyway.  Unfortunately, this does not give the user the opportunity to halt a lengthy process, nor does it give other applications running under MultiFinder or System 7 any processing time.  Tools Plus solves this dilemma by shifting into a busy mode when the watch cursor is displayed.
  91.  
  92.   When your application displays the watch cursor, subsequent calls to PollSystem will filter out (discard) the effects of, and the events that may be generated by the user clicking the mouse or typing.  The exception to this, of course, is when the user types Command-. which tells your application to halt the process.  This lets your application call PollSystem regularly while it is busy conducting a lengthy task, knowing that any key or mouse event is meaningful (it indicates that the user wants to halt the process).  Your application may choose not to call PollSystem or to ignore the Command-. key if it’s busy only for a very short time.
  93.  
  94.   When your application is finished its lengthy process, it can either change the cursor itself or call ResetCursor to change the cursor to its appropriate shape according to its position on the screen.
  95.  
  96. Note: When the watch cursor is displayed, your application may receive
  97.       Tools Plus events that are unrelated to mouse clicks or typing,
  98.       such as redrawing a window (doRefresh) or a disk insert event.
  99.  
  100. Warning: If your application is running under MultiFinder or System 7
  101.          (or later), it is possible to switch to another application
  102.          while a watch cursor is displayed unless your active window is
  103.          of type dBoxProc.
  104.  
  105.  
  106.  
  107.  
  108.  
  109. The Event Queue
  110. ```````````````
  111.   When events are generated, they are stored in an event queue.  When your application is ready to process them, the oldest event is removed from the queue and processed first.  This journaling mechanism lets the Macintosh remember a series of rapidly occurring events and store them until your application is ready to process them.
  112.  
  113.   Events have a certain priority, meaning that some events will be processed before others, regardless of when they were actually generated.  Their priority is as such:
  114.  
  115.   1. activate/deactivate a window
  116.  
  117.   2. mouse-down/up, key down/up, disk insert, network driver,
  118.      application-defined events (first in first out)
  119.  
  120.   3. auto-key (key pressed and held, causing it to repeat)
  121.  
  122.   4. update a window (refresh a window in front-to-back order)
  123.  
  124.   The priority of events insures that illogical events are not reported.  For instance, the user may click twice in a window’s close box before an application gets around to processing the event.  The first click will signal your application to close the window.  The second click will not be reported as a click in a non-existent (closed) window.  The second click’s location will be analyzed after the window is closed, and reported accordingly.
  125.  
  126.   Tools Plus works in an identical manner when interacting with the event queue.  In fact, Tools Plus obtains events from the Macintosh’s Toolbox Event Manager and translates them into something useful before reporting them to your application.
  127.  
  128. Note: The event queue can store a maximum of 20 events.  If your
  129.       application is so busy that it lets more than 20 events accumulate
  130.       in the queue, the oldest events will be discarded to make room for
  131.       the new ones.
  132.  
  133.  
  134.  
  135.  
  136.  
  137. Tools Plus Event Record
  138. ```````````````````````
  139.   Whenever Tools Plus detects an event that cannot be processed automatically, it provides your application with the event’s information in the form of an event record.  Although the event record looks cumbersome, it is logically organized and is very easy to use.
  140.  
  141.   The entire record accounts for every type of event that can possibly occur.  During any one specific event, your application will only need to access one or two of these fields.  Later in this chapter when you are told how to respond to the various Tools Plus events, you will also be told which fields in the event record hold pertinent information.
  142.  
  143.   The event record is defined as follows (C first, then Pascal):
  144.  
  145.  
  146. /*= Polling record's "event modifiers" info*/
  147.   union TPModifiersRec {             /*This variable record contains  */
  148.                                      /*  an event's "modifiers" in 2  */
  149.                                      /*  formats…                     */
  150.                                      /*  • Macintosh Event:           */
  151.     int Num;                         /*      integer (bit operations  */
  152.                                      /*      required)                */
  153.                                      /*  • Modifier integer parsed    */
  154.     struct {                         /*    into components:           */
  155.       unsigned int bit15 :1;         /* (reserved bit)                */
  156.       unsigned int bit14 :1;         /* (reserved bit)                */
  157.       unsigned int bit13 :1;         /* (reserved bit)                */
  158.       unsigned int ControlKey :1;    /* Control key was down at event */
  159.       unsigned int OptionKey :1;     /* Option key was down at event  */
  160.       unsigned int CapsLock :1;      /* Caps Lock was down at event   */
  161.       unsigned int ShiftKey :1;      /* Shift key was down at event   */
  162.       unsigned int CmdKey :1;        /* Command key was down at event */
  163.       unsigned int MouseUp :1;       /* Mouse button was UP at event  */
  164.       unsigned int bit6 :1;          /* (reserved bit)                */
  165.       unsigned int bit5 :1;          /* (reserved bit)                */
  166.       unsigned int bit4 :1;          /* (reserved bit)                */
  167.       unsigned int bit3 :1;          /* (reserved bit)                */
  168.       unsigned int bit2 :1;          /* (reserved bit)                */
  169.       unsigned int bit1 :1;          /* (reserved bit)                */
  170.       unsigned int bit0 :1;          /* (reserved bit)                */
  171.     } Bits;                          /*                               */
  172.   };
  173.   typedef union TPModifiersRec TPModifiersRec;
  174. /*= Polling record's "button" info*/
  175.   struct TPPollButtonRec {
  176.     int Num;                         /*Button number                  */
  177.     Boolean DoubleClick;             /*Did a double-click occur in the*/
  178.   };                                 /*  button?                      */
  179.   typedef struct TPPollButtonRec TPPollButtonRec;
  180. /*= Polling record's "scroll bar" info*/
  181.   struct TPPollScrollBarRec {
  182.     int Num;                         /*Scroll bar number              */
  183.     int Part;                        /*Scroll bar's part              */
  184.   };
  185.   typedef struct TPPollScrollBarRec TPPollScrollBarRec;
  186. /*= Polling record's "list box" info*/
  187.   struct TPPollListBoxRec {
  188.     int Num;                         /*List box number                */
  189.     Boolean DoubleClick;             /*Did a double-click occur in a  */
  190.   };                                 /*  line?                        */
  191.   typedef struct TPPollListBoxRec TPPollListBoxRec;
  192. /*= Polling record's "menu" info*/
  193.   struct TPPollMenuRec {
  194.     int Num;                         /*Menu number                    */
  195.     int Item;                        /*Menu item number               */
  196.   };
  197.   typedef struct TPPollMenuRec TPPollMenuRec;
  198. /*= Polling record's "key-stroke" info*/
  199.   struct TPPollKeyRec {
  200.     int Code;                        /*Key number of key-stroke       */
  201.     char Chr;                        /*Character generated by key     */
  202.     Byte Unused;                     /* (reserved byte)               */
  203.   };
  204.   typedef struct TPPollKeyRec TPPollKeyRec;
  205. /*= Polling record's “mouse location and time” info for mouse-down and*/
  206. /*  mouse-up events                                                   */
  207.   struct TPPollMousePointRec {
  208.     Point Where;                     /*Event location in local co-    */
  209.                                      /*  ordinates                    */
  210.     long When;                       /*Event time in ticks from boot  */
  211.                                      /*  (1/60 sec)                   */
  212.     TPModifiersRec Modifiers;        /*Event modifiers                */
  213.   };
  214.   typedef struct TPPollMousePointRec TPPollMousePointRec;
  215. /*= Polling record's "mouse click/drag" info*/
  216.   struct TPPollMouseRec {
  217.     int What;                        /*What type of mouse event (click*/
  218.                                      /*  or drag?)                    */
  219.     TPPollMousePointRec Down[3];     /*Where & when did the mouse-down*/
  220.                                      /*  occur                        */
  221.     TPPollMousePointRec Up[3];       /*Where & when did the mouse-up  */
  222.                                      /*  occur                        */
  223.     Point Where;                     /*Current mouse location in local*/
  224.   };                                 /*  co-ordinates                 */
  225.   typedef struct TPPollMouseRec TPPollMouseRec;
  226. /*= POLLING record for Tools Plus*/
  227.   struct TPPollRecord {              /*Tools Plus Polling record…     */
  228.     int What;                        /*What type of event?            */
  229.     int Window;                      /*Window number of the event     */
  230.     TPPollButtonRec Button;          /*Button number & double-click   */
  231.                                      /*  status                       */
  232.     TPPollScrollBarRec ScrollBar;    /*Scroll bar number & scroll bar */
  233.                                      /*  part                         */
  234.     int Field;                       /*Field number of event          */
  235.     TPPollListBoxRec ListBox;        /*List box number & double-click */
  236.                                      /*  status                       */
  237.     TPPollMenuRec Menu;              /*Menu number/menu item of an    */
  238.                                      /*  event                        */
  239.     TPPollKeyRec Key;                /*Character generated by key     */
  240.                                      /*  stroke                       */
  241.     TPPollMouseRec Mouse;            /*Click/drag info: [1..3] where &*/
  242.                                      /*  when                         */
  243.     TPModifiersRec Modifiers;        /*Modifier flags                 */
  244.     EventRecord Event;               /*Macintosh Toolbox Event (raw)  */
  245.   };
  246.   typedef struct TPPollRecord TPPollRecord;
  247.   typedef TPPollRecord *TPPollPointer;/*Pointer to a Polling record   */
  248.  
  249.  
  250.  
  251. type
  252. {= Polling record's "event modifiers" info}
  253.   TPModifiersRec = packed record       {This variable record contains  }
  254.                                        {  an event's "modifiers" in 2  }
  255.     case integer of                    {  formats…                     }
  256.       0: (                             {  • Macintosh Event:           }
  257.         Num: integer                   {      integer (bit operations  }
  258.       );                               {      required)                }
  259.       1: (                             {  • Modifier integer parsed    }
  260.                                        {    into components:           }
  261.         bit15, bit14, bit13: boolean;  { (reserved bits)               }
  262.         ControlKey: boolean;           { Control key was down at event }
  263.         OptionKey: boolean;            { Option key was down at event  }
  264.         CapsLock: boolean;             { Caps Lock was down at event   }
  265.         ShiftKey: boolean;             { Shift key was down at event   }
  266.         CmdKey: boolean;               { Command key was down at event }
  267.         MouseUp: boolean;              { Mouse button was UP at event  }
  268.         bit6, bit5, bit4, bit3, bit2,  { (reserved bits)               }
  269.         bit1,bit0: boolean;            {                               }
  270.       );                               {                               }
  271.     end;
  272. {= Polling record's “button” info}
  273.   TPPollButtonRec = record
  274.     Num: integer;                      {Button number                  }
  275.     DoubleClick: boolean               {Did a double-click occur in the}
  276.    end;                                {  button?                      }
  277. {= Polling record’s “scroll bar” info}
  278.   TPPollScrollBarRec = record
  279.     Num: integer;                      {Scroll bar number              }
  280.     Part: integer                      {Scroll bar’s part              }
  281.   end;
  282. {= Polling record’s “list box” info}
  283.   TPPollListBoxRec = record
  284.     Num: integer;                      {List box number                }
  285.     DoubleClick: boolean               {Did a double-click occur in a  }
  286.   end;                                 {  line?                        }
  287. {= Polling record’s “menu” info}
  288.   TPPollMenuRec = record
  289.     Num: integer;                      {Menu number                    }
  290.     Item: integer                      {Menu item number               }
  291.   end;
  292. {= Polling record’s “key-stroke” info}
  293.   TPPollKeyRec = packed record
  294.     Code: integer;                     {Key number of key-stroke       }
  295.     Chr: char;                         {Character generated by key     }
  296.     Unused: byte;                      { (reserved byte)               }
  297.   end;
  298. {= Polling record’s “mouse location and time” info for mouse-down and  }
  299. {  mouse-up events.                                                    }
  300.   TPPollMousePointRec = record
  301.     Where: point;                      {Event location in local co-    }
  302.                                        {  ordinates.                   }
  303.     When: longint;                     {Event time in ticks from boot  }
  304.                                        {  (1/60 sec)                   }
  305.     Modifiers: TPModifiersRec;         {Event modifiers                }
  306.   end;
  307. {= Polling record’s “mouse click/drag” info}
  308.   TPPollMouseRec = record
  309.     What: integer;                     {What type of mouse event (down }
  310.                                        {  or up)?                      }
  311.     Down: array[1..3] of TPPollMousePointRec; {Where & when did the    }
  312.                                               {  mouse-down occur?     }
  313.     Up: array[1..3] of TPPollMousePointRec;   {Where & when did the    }
  314.                                               {  mouse-up occur?       }
  315.     Where: point;                      {Current mouse location in local}
  316.   end;                                 {  co-ordinates.                }
  317.  
  318. {= POLLING record for “Tools Plus” }
  319.   TPPollRecord = record
  320.     What: integer;                     {What type of event?            }
  321.     Window: integer;                   {Event’s window number          }
  322.     Button: TPPollButtonRec;           {Button number & double-click   }
  323.                                        {  status.                      }
  324.     ScrollBar: TPPollScrollBarRec;     {Scroll bar number & scroll bar }
  325.                                        {  part.                        }
  326.     Field: integer;                    {Field number of event          }
  327.     ListBox: TPPollListBoxRec;         {List box number/double-click   }
  328.                                        {  status.                      }
  329.     Menu: TPPollMenuRec;               {Menu number/menu item of an    }
  330.                                        {  event.                       }
  331.     Key: TPPollKeyRec;                 {Key number & character of key- }
  332.                                        {  stroke.                      }
  333.     Mouse: TPPollMouseRec;             {Click/drag info: [1..3] where &}
  334.                                        {  when.                        }
  335.     Modifiers: TPModifiersRec;         {Modifier flags                 }
  336.     Event: EventRecord                 {Pascal event record            }
  337.   end;
  338.   TPPollPointer = ^TPPollRecord;       {Pointer to a Polling record, in}
  339.                                        {  case you want to reduce      }
  340.                                        {  global variable memory.      }
  341.  
  342.  
  343.  
  344.  
  345.  
  346. Event Record Fields
  347. ```````````````````
  348.   The event record’s structure is best explained by detailing each subrecord and field with a programmer’s approach.  This explanation looks at the event record in detail, starting from the record level and ending with fields.
  349.  
  350.   Your application should define a variable or pointer than lets it use the polling record.  In the following text, the assumption has been made that the variable is called Poll.  If your application uses a pointer, replace Poll with Poll^ in the text.
  351.  
  352.   Note that all fields are not valid at the same time.  For example, the window field would not contain a valid number when a menu event was reported, because menus work independently of windows.  A “Field to Event Cross Reference” is included later in this section, and it lists each field and the events that make use of it.
  353.  
  354.  
  355. Poll
  356. ````
  357.   This variable is the entire polling record, and is of TPPollRecord type (it is a TPPollPointer type if your application is using a pointer to the record)
  358.  
  359.  
  360. Poll.What
  361. `````````
  362.   Event Code: Explains what type of event has occurred.  This field is used by your application to decide what action should be taken, and what other fields contain pertinent event information.
  363.  
  364.  
  365. Poll.Window
  366. ```````````
  367.   Window Number: Window number on which the event occurred.
  368.  
  369.  
  370. Poll.Button
  371. ```````````
  372.   Button Record
  373.  
  374.  
  375. Poll.Button.Num
  376. ```````````````
  377.   Button Number: Button number that was clicked by the user.
  378.  
  379.  
  380. Poll.Button.DoubleClick
  381. ```````````````````````
  382.   Button’s Double-Click Status: Was the button double-clicked?
  383.  
  384.  
  385. Poll.ScrollBar
  386. ``````````````
  387.   Scroll Bar Record
  388.  
  389.  
  390. Poll.ScrollBar.Num
  391. ``````````````````
  392.   Scroll Bar Number: Scroll bar number that was clicked by the user.  This does not include a scroll bar that is part of a list box.
  393.  
  394.  
  395. Poll.ScrollBar.Part
  396. ```````````````````
  397.   Scroll Bar Part: Part of scroll bar that was clicked by user (up arrow, down arrow, “page up” region, “page down” region, thumb)
  398.  
  399.  
  400. Poll.Field
  401. ``````````
  402.   Editing Field Number: Editing field that was clicked by the user.
  403.  
  404.  
  405. Poll.ListBox
  406. ````````````
  407.   List Box Record
  408.  
  409.  
  410. Poll.ListBox.Num
  411. ````````````````
  412.   List Box Number: List box number that was clicked by the user.
  413.  
  414.  
  415. Poll.ListBox.DoubleClick
  416. ````````````````````````
  417.   List Box’s Double-Click Status: Was a line in the list box double-clicked?
  418.  
  419.  
  420. Poll.Menu
  421. `````````
  422.   Menu Record
  423.  
  424.  
  425. Poll.Menu.Num
  426. `````````````
  427.   Menu Number: Menu number that was selected by the user.
  428.  
  429.  
  430. Poll.Menu.Item
  431. ``````````````
  432.   Menu Item: Item number that was selected by the user.
  433.  
  434.  
  435. Poll.Key
  436. ````````
  437.   Key Record
  438.  
  439.  
  440. Poll.Key.Code
  441. `````````````
  442.   Key Number: Number of the key that was pressed, released, or is auto-repeating.  This key code is a key number that is not affected by the Caps Lock, Shift, Option, Command and Control modifiers.
  443.  
  444.  
  445. Poll.Key.Chr
  446. ````````````
  447.   Key Character: Character resulting from a key that was pressed, released, or is auto-repeating.  This character is altered by the Caps Lock, Shift, Option, Command and Control modifiers.
  448.  
  449.  
  450. Poll.Mouse
  451. ``````````
  452.   Mouse Activity Record
  453.  
  454.  
  455. Poll.Mouse.What
  456. ```````````````
  457.   Mouse Event Code: Type of mouse event has occurred (i.e. single, double, triple-click, dragging, etc.).  This field is used by your application to decide what action should be taken, and which other fields in the mouse record contain pertinent information.
  458.  
  459.  
  460. Poll.Mouse.Down
  461. ```````````````
  462.   Mouse-Down Array Record: The elements of the array contain the first, second and third mouse-down event of a single, double, or triple-click, or drag.
  463.  
  464.  
  465. Poll.Mouse.Down[1].Where
  466. ````````````````````````
  467.   Mouse Down Location: Location of 1st mouse-down in a single, double, or triple-click, or drag.  Window’s local co-ordinates are used.
  468.  
  469.  
  470. Poll.Mouse.Down[1].When
  471. ```````````````````````
  472.   Mouse Down Time: Time of 1st mouse-down.  Number of “ticks” since startup.
  473.  
  474.  
  475. Poll.Mouse.Down[1].Modifiers
  476. ````````````````````````````
  477.   Mouse Down Modifier Record: Event modifiers at the time of the 1st mouse-down event.  See the note on modifiers below.
  478.  
  479.  
  480. Poll.Mouse.Down[2]…
  481. ```````````````````
  482.   Mouse-Down Array Record: Same fields, but for 2nd mouse-down in a double, or triple-click, or drag.
  483.  
  484.  
  485. Poll.Mouse.Down[3]…
  486. ```````````````````
  487.   Mouse-Down Array Record: Same fields, but for 3rd mouse-down in a triple-click, or drag.
  488.  
  489.  
  490. Poll.Mouse.Up
  491. `````````````
  492.   Mouse-Up Array Record: The elements of the array contain the first, second and third mouse-up event of a single, double, or triple-click, or drag.
  493.  
  494.  
  495. Poll.Mouse.Up[1].Where
  496. ``````````````````````
  497.   Mouse Up Location: Location of 1st mouse-up in a single, double, or triple-click, or drag.  Window’s local co-ordinates are used.
  498.  
  499.  
  500. Poll.Mouse.Up[1].When
  501. `````````````````````
  502.   Mouse Up Time: Time of 1st mouse-up.  Number of “ticks” since startup.
  503.  
  504.  
  505. Poll.Mouse.Up[1].Modifiers
  506. ``````````````````````````
  507.   Mouse Up Modifier Record: Event modifiers at the time of the 1st mouse-up event.  See the note on modifiers below.
  508.  
  509.  
  510. Poll.Mouse.Up[2]…
  511. `````````````````
  512.   Mouse-Up Array Record: Same fields, but for 2nd mouse-up in a double, or triple-click, or drag.
  513.  
  514.  
  515. Poll.Mouse.Up[3]…
  516. `````````````````
  517.   Mouse-Up Array Record: Same fields, but for 3rd mouse-up in a triple-click, or drag.
  518.  
  519.  
  520. Poll.Mouse.Where
  521. ````````````````
  522.   Mouse Location: Current mouse location in window’s local co-ordinates.
  523.  
  524.  
  525. Poll.Modifiers
  526. ``````````````
  527.   Modifier Record: Event modifiers at the time when the event occurred.  See the note on modifiers below.
  528.  
  529.  
  530. Poll.Event
  531. ``````````
  532.   The Event Manager’s Event Record: A completely unaltered event record as retrieved from the Toolbox Event Manager.  This is used for applications that want to process their own custom events or custom controls.
  533.